package com.apes.scm.masterdata.statistics.service;

import com.apes.framework.api.DomainService;
import com.apes.framework.plugin.esb.api.SimpleRequest;
import com.apes.scm.masterdata.statistics.model.MenuStatistics;
import com.apes.scm.masterdata.statistics.repository.MenuStatisticsRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 用来统计菜单使用的情况
 */
@Service
public class MenuStatisticsService extends DomainService {

    @Autowired
    private MenuStatisticsRepository menuStatisticsRepository;

    /**
     * 添加
     * @param request
     */
    public void add(SimpleRequest request){
        MenuStatistics menuStatistics = request.getO(MenuStatistics.class);
        menuStatisticsRepository.saveAndFlush(menuStatistics);
    }
}
